package org.parngon.maze;

import java.awt.RenderingHints;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Color;
import java.awt.Stroke;
import java.awt.BasicStroke;

import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JButton;

public class StrokeTest extends JPanel
{
/*
  public static void main(String argv[])
  {
    JFrame mf = new JFrame("Stroke Test");
    mf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JPanel aPanel = new StrokeTest();
    JLabel widthLabel = new JLabel();

    final Maze aMaze = new Maze(50, 30);
    MazePanel aPanel = new MazePanel();

    final MazeController controller = new MazeController();
    controller.setView(aPanel);
    controller.setModel(aMaze);

    mf.getContentPane().add(aPanel, BorderLayout.CENTER);

    Font dFont = new Font("Tahoma", Font.PLAIN, 12);

    JPanel bp = new JPanel();

    class MazeStatusLabel extends JLabel implements MazeListener
    {
      public void mazeChanged(MazeEvent me)
      {
        setText(me.getMessage());
      }
    }
    final MazeStatusLabel lStatus = new MazeStatusLabel();
    lStatus.setFont(dFont);
    aMaze.addMazeListener(lStatus);

    JLabel lSeed = new JLabel("Seed:");
    lSeed.setFont(dFont);
    final JTextField tSeed = new JTextField();
    tSeed.setPreferredSize(new Dimension(100, 20));
    JLabel lWidth = new JLabel("Width:");
    lWidth.setFont(dFont);
    final JTextField tWidth = new JTextField();
    tWidth.setText("50");
    tWidth.setPreferredSize(new Dimension(40, 20));
    JLabel lHeight = new JLabel("Height:");
    lHeight.setFont(dFont);
    final JTextField tHeight = new JTextField();
    tHeight.setPreferredSize(new Dimension(40, 20));
    tHeight.setText("30");
    JLabel lBWall = new JLabel("Walls breaking:");
    lBWall.setFont(dFont);
    final JTextField tBWall = new JTextField();
    tBWall.setPreferredSize(new Dimension(40, 20));
    tBWall.setText("0.3");
    JLabel lFDends = new JLabel("Deadends filling:");
    lFDends.setFont(dFont);
    final JTextField tFDends = new JTextField();
    tFDends.setPreferredSize(new Dimension(40, 20));
    tFDends.setText("0.0");
    JButton regen = new JButton("Generate");
    regen.setMargin(new Insets(2, 2, 2, 2));
    regen.setPreferredSize(new Dimension(70, 20));
    regen.setFont(dFont);
    regen.addActionListener(
      new ActionListener() {
        public void actionPerformed(ActionEvent ae)
        {
          long s = System.currentTimeMillis();
          if ( tSeed.getText().trim().length() > 0 ) {
            s = Long.parseLong(tSeed.getText());
          } else {
            tSeed.setText(String.valueOf(s));
          }
          int w = Integer.parseInt(tWidth.getText());
          int h = Integer.parseInt(tHeight.getText());
          double bw = Double.parseDouble(tBWall.getText());
          double fde = Double.parseDouble(tFDends.getText());
          if ( w == aMaze.getWidth() && h == aMaze.getHeight() ) {
            controller.setModel(aMaze);
            aMaze.addMazeListener(lStatus);
            aMaze.generate(s);
            aMaze.breakWalls(bw);
            aMaze.fillDeadends(fde);
          } else {
            aMaze.removeMazeListener(lStatus);

            Maze newMaze = new Maze(w, h);
            controller.setModel(newMaze);
            newMaze.addMazeListener(lStatus);
            newMaze.generate(s);
            newMaze.breakWalls(bw);
            newMaze.fillDeadends(fde);
          }
        }
      }
    );

    bp.add(lSeed);
    bp.add(tSeed);
    bp.add(lWidth);
    bp.add(tWidth);
    bp.add(lHeight);
    bp.add(tHeight);
    bp.add(regen);
    bp.add(lBWall);
    bp.add(tBWall);
    bp.add(lFDends);
    bp.add(tFDends);
    bp.add(lStatus);

    mf.getContentPane().add(bp, BorderLayout.SOUTH);

    aMaze.generate();
    aMaze.breakWalls(0.3);

    Dimension ss = Toolkit.getDefaultToolkit().getScreenSize();
    mf.setSize(ss.width * 4 / 5, ss.height * 4 / 5);
    mf.setLocation((ss.width - mf.getWidth()) / 2, (ss.height - mf.getHeight()) / 2);
    mf.setVisible(true);
  }
*/
}
